import { logMouse } from './hoc/logMouse';
const MyMain = logMouse(Main);
const MyFooter = logMouse(Footer);
const MyHeader = logMouse(Header);

export default function App() {
  return (
    <div>
      App
      <hr />
      <MyHeader />
      <MyMain />
      <MyFooter />
    </div>
  );
}

function Main({ mouse, handleMouseMove }) {
  return (
    <div onMouseMove={handleMouseMove}>
      我是
      <h1>
        Main- {mouse.x} -{mouse.y}
      </h1>
    </div>
  );
}

function Footer({ mouse, handleMouseMove }) {
  return (
    <h1 onMouseMove={handleMouseMove}>
      我是Footer - {mouse.x} - {mouse.y}
    </h1>
  );
}

function Header({ mouse, handleMouseMove }) {
  return (
    <div onMouseMove={handleMouseMove}>
      <h1>
        x: {mouse.x} - y: {mouse.y}
      </h1>
    </div>
  );
}
